A packet processor inputs a stream of packets, manipulates the contents of the packets, and outputs another stream of modified network packets. The particular manipulations may implement a specific protocol for processing network packets, such as a protocol layer of a communication protocol, and for a high-level packet received from a higher protocol layer and delivered to a lower protocol layer for eventual transmission on the communication media. The manipulations may encapsulate the high-level packet within a low-level packet of the lower protocol layer.
The particular manipulations of packet data may be pipelined in order to increase throughput of the packet processor. The pipeline would typically include multiple stages, each stage performing one or more of the manipulations. First-in-first-out queues may be used between stages of the pipeline for buffering of the packet data.
State data associated with the manipulations of the packet data may need to be shared between pipeline stages. Sharing state data between pipeline stages may be accomplished using shared memory schemes with semaphores, lock mechanisms, and so forth. However, such mechanisms may be costly to implement in terms of required hardware resources and design efforts.
The present invention may address one or more of the above issues.